package com.hsogoo.avatar;

import com.hsogoo.avatar.registry.AvatarRegistry;
import com.hsogoo.avatar.registry.RegistryLoader;
import com.hsogoo.avatar.transport.AvatarAcceptor;

/**
 * Created by za-huangsaigang on 2018/10/15.
 */
public class AvatarServer {

    private AvatarAcceptor acceptor;
    private AvatarRegistry registry;

    public AvatarServer(String registryAddress){
        registry = RegistryLoader.loadDefaultRegistry();
        registry.connectToRegistryServer(registryAddress);
    }

    public AvatarServer(String registryAddress, AvatarRegistry registry){
        this.registry = registry;
        registry.connectToRegistryServer(registryAddress);
    }

    public AvatarServer withAcceptor(AvatarAcceptor acceptor){
        this.acceptor = acceptor;
        return this;
    }

    public void start(){

    }

}
